package com.bootdo.mall.dao;

import com.bootdo.common.utils.R;
import com.bootdo.mall.domain.MallOrder;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.bootdo.mall_part.domain.StatusNumberVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * 订单记录
 * @author haojiangbo
 * @email 2100272728@qq.com
 * @date 2019-10-25 16:19:11
 */
@Mapper
public interface MallOrderDao {

	MallOrder get(Long id);


	MallOrder getByOrderId(@Param("orderId") String orderId);




	
	List<MallOrder> list(Map<String,Object> map);

	List<MallOrder> getSum(Map<String, Object> map);

	List<Integer> getSumCount(Map<String, Object> map);

	Integer updatePayStatus (@Param("id")Long id,@Param("newStatus")Integer newStatus,@Param("oldStatus")Integer oldStatus,@Param("payMoney")Double payMoney);


	Integer updatePayStatusByOrderNo (@Param("orderNo")String orderNo,
									  @Param("newStatus")Integer newStatus,
									  @Param("payOrderNo")String payOrderNo,
									  @Param("oldStatus")Integer oldStatus);

	Integer updatePayStatusByOrderId (@Param("orderId")String orderId,
									  @Param("newStatus")Integer newStatus,
									  @Param("overOrderTime")Long overOrderTime,
									  @Param("wuliuName")String wuliuName,
									  @Param("wuliuOrderNo")String wuliuOrderNo,
									  @Param("oldStatus")Integer oldStatus);

	Integer updateFahuoTimeByOrderId (@Param("orderId")String orderId,
									  @Param("fahuoTime") Date fahuoTime);



	Integer delPriceByOrderId (@Param("orderId")String orderId,
							   @Param("price")Double price,
							   @Param("num")Integer num
							   );



	int count(Map<String,Object> map);

	Map getTotalOrderPar(Map<String,Object> map);

	List<StatusNumberVo> statusCount(Map<String, Object> map);
	
	int save(MallOrder mallOrder);
	
	int update(MallOrder mallOrder);
	
	int remove(String orderNo);
	
	int batchRemove(Long[] ids);

	List<Map> tongJi(HashMap<String, Object> map);
}
